The Legendre transformation is an operation on convex function?s from a real normed vector space to the real line; it is one of the cornerstones of convex analysis?. The space of arguments changes accordingly.
The main application is in the differentiable setup in classical physics and symplectic geometry. In classical mechanics, the Hamiltonian function is a Legendre transform of the Lagrangean and vice versa; in many dimensions, hybrid versions are possible. When the physics of the system is given by the variational principle, then the Legendre transform of an extremal quantity is a conserved quantity. In thermodynamics, we can have some quantities set to be fixed (some candidates: entropy , temperature , pressure , volume , magnetization ); this dictates the choice of variables and quantity which is extremized as well as which one takes the role of conserved energy. Some of the standard choices are enthalpy , Helmholtz free energy , Gibbs free energy , internal energy , etc.
See also wikipedia:Legendre transformation and wikipedia:Legendre-Fenchel transformation; the two wikipedia articles have much detail in certain specific approaches and cases, but also miss some of the basic ones to be balanced.
Discussion of Legendre transformation in the context of Lie algebroids is in:
Paulette Liberman, Lie algebroids and mechanics (ps)
Juan Carlos Marrero et al, A survey of Lagrangian mechanics and control on Lie algebroids and Lie groupoids (pdf)
Juan Carlos Marrero, Nonholonomic mechanics: a Lie algebroid perspective (pdf talk notes)