My favourite book in this area is an oldy but a goody: Classical Mechanics by Herbert Goldstein. It's a comprehensive graduate-level text on the Lagrangian and Hamiltonian formulations of classical physics, starting with the descrete case and, later in the book, generalising to the continuum...