Epsom salts, a strong laxative used in veterinary medicine, is a hydrate, which means that a certain number of water molecules are included in the solid structure. The formula for Epsom salts can be written as $\mathrm{MgSO}_{4} \cdot x \mathrm{H}_{2} \mathrm{O},$ where $x$ indicates the number of moles of $\mathrm{H}_{2} \mathrm{O}$ per mole of $\mathrm{MgSO}_{4}$ When 5.061 $\mathrm{g}$ of this hydrate is heated to $250^{\circ} \mathrm{C},$ all the water of hydration is lost, leaving 2.472 g of MgSO $_{4} .$ What is the value of $x ?$