Laws of thermodynamics for exponential families