Energy magnetization and the thermal Hall effect