Observation of the transition to the spin-glass phase in La2-xSrxCuO4 by inelastic spectroscopy