Investigation of Mass‐/Charge‐Dependent Escape of Energetic Ions Across the Magnetopauses of Earth and Jupiter