Predicting the onset of quantum synchronization using machine learning