Counterfactual optimization for fault prevention in complex wind energy systems