Thermal transport, geometry, and anomalies