H-FEX: A Symbolic Learning Method for Hamiltonian Systems