There is no such thing as lattice enthalpy of formation. Lattice energy and enthalpy of formation are different things.
-537.6 kJ/mol is the enthalpy of formation of Ba2+(aq). This is not calculated; it is derived from experiment. It can't be directly measured, but it can be derived from things that can be measured, by Hess's law, and some necessary conventions (e.g. that ΔHf° of H+(aq) ≡ 0).