This paper reports a new approach in defining preventive control measures to assure transient stability relatively to one or several contingencies that may occur separately in a power system. Generation dispatch is driven not only by economic functions but also with the derivatives of the transient energy margin value; these derivatives are obtained directly from a trained Artificial Neural Network (ANN), using real time monitorable system values. Results obtained from computer simulations, for several contingencies in the CIGRE test system, confirm the validity of the developed approach.