Given a function $f(x,y)$, a legendre transform w.r.t. $x$ is $f^*(p,y)=p x - f(x,y) |_{p=\frac {\partial f(x,y)}{\partial x}}$.
E.g. , the various free energies, enthalpy, etc are all legendre transformations of internal energy.
It seems surpising to me that a multitidue (all?) of the important concepts in thermodynamics are derived from legendre transformations, and moreover that the legendre transformation is also the basis of hamiltonian fornalism. Why is this mathematical formalism so fundamental? I would not have been able to know this just based on looking at the definition of the legendre transformation itself.