Current and former officials said the offensive shift turned on two developments: new intelligence showing the Chinese military directing cyberspying campaigns, and a sudden change in U.S. companies’ willingness to acknowledge Chinese cyberincursions.