Predicting solar eruptions via magnetic winding