August has flipped the stock-market script: Once-forgotten sectors are now leading the charge as Big Tech lags.