Machine Prediction of Topological Transitions in Photonic Crystals