Legendre Transform Equivalence of Euler--Lagrange and Hamilton Equations