Rapid detection of rare events from in situ X-ray diffraction data using machine learning