Uncovering Magnetic Phases with Synthetic Data and Physics-Informed Training