Text this: Predicting critical transitions with machine learning trained on surrogates of historical data