Beth Hammack warned a rate hike may be needed if inflation stays above target as the war pushes gas prices to multiyear highs.