Anthropic is investing $3.4 billion in natural gas generators to secure electricity for AI infrastructure amid growing shortages and rising energy costs.