Machine learning to uncover the physics of Earth’s magnetic field generation