AI is pushing energy demands to unprecedented heights, but it may also help prevent the worst impacts of grid strain.