TJX Companies has taken market share from competitors like Macy’s and Target as price-sensitive consumers look for a deal amid persistent inflation.