During early stage of primary restoration process, unexpected Overvoltages may happen due to nonlinear interaction between the unloaded transformer and the transmission system. The most effective method for the limitation of the switching overvoltages is controlled switching since the magnitudes of the produced transients are strongly dependent on the closing instants of the switch. We introduce a harmonic index that it's minimum value is corresponding to the best case switching time. Also, this paper presents an artificial neural network (ANN)-based approach to estimate the optimum switching instants for real time applications. In the proposed ANN, Levenberg-Marquardt second order method is used to train the multilayer perceptron. To verify the effectiveness of the proposed index and accuracy of the ANN-based approach, two case studies are presented and demonstrated.