U.S. stocks have posted a formidable election-year rally thus far in 2024. But as investors query whether that rally will proceed, they’re watching inflation and economic-growth data to gauge the Federal Reserve’s potential interest-rate path, in addition to corporate earnings within the second half of this yr.