Non-equilibrium phase transitions in glassy systems are often indicated by a dramatic change of dynamics, accompanied by subtle and ambiguous structural signatures. This fact has motivated a number of recent studies attempting to pinpoint predictors that correlate structural order to dynamics in glasses, via the application of modern machine learning techniques. Here we develop a general machine learning approach, based on a two-level nested neural network, which autonomously extracts glass order parameters characterizing caging dynamics. Combining machine learning with finite-size scaling analyses, we can identify, and distinguish between, first-and second-order nonequilibrium phase transitions, demonstrated by studying melting and Gardner transitions in a simulated hard sphere glass model. Our machine learning results also suggest that the liquid-to-glass transition, as widely accepted, is a smooth crossover rather than a sharp phase transition. Our approach makes use of the power of neural networks in learning hidden dynamical features of different phases, bypassing the difficulties in defining structural order in disordered systems.