Ultrafast magnetization dynamics are governed by energy flow between electronic, magnetic, and lattice degrees of freedom. A quantitative understanding of these dynamics must be based on a model that agrees with experimental results for all three subsystems. However, ultrafast dynamics of the lattice remain largely unexplored experimentally. Here we combine femtosecond electron diffraction experiments of the lattice dynamics with energy-conserving atomistic spin dynamics (ASD) simulations and ab initio calculations to study the intrinsic energy flow in the 3d ferromagnets cobalt (Co) and iron (Fe). The simulations yield a good description of experimental data, in particular an excellent description of our experimental results for the lattice dynamics. We find that the lattice dynamics are influenced significantly by the magnetization dynamics due to the energy cost of demagnetization. Our results highlight the role of the spin system as the dominant heat sink in the first hundreds of femtoseconds. Together with previous findings for nickel [Zahn et al., Phys. Rev. Research 3, 023032 (2021)], our work demonstrates that energy-conserving ASD simulations provide a general and consistent description of the laser-induced dynamics in all three elemental 3d ferromagnets.