The transformer is a fundamental piece of equipment for power grids. The analysis and optimization of their life-cycle costs are of great importance to reinforce the economic efficiency of electrical networks. This paper constructs a comprehensive transformer life-cycle cost (LCC) model by fusing life-cycle cost theory with relevant transformer expenditure. It proceeds to examine the life-cycle cost aspects of the transformer, delving into its cost dynamics under various influencing factors, establishing interconnections between these factors and analyzing the cost relationship. By employing MATLAB software (Matlab 2021a) along with the whale optimization algorithm (WOA) this paper optimizes the objective function. Through this, it establishes the LCC model for 20 power transformers, obtaining the optimal objective function curve and the maximum value for LCC optimization of the transformer. Unlike previous research, this study adds a detailed analysis of several factors that influence LCC. At the same time, it develops a more complete, scientific and rational LCC optimization model. An illustrative example validates the model and the superiority of the whale optimization algorithm. The algorithm not only shows its scientific basis and superiority, but also serves as a guiding mechanism for LCC management in transformer engineering practices. Ultimately, it emerges as a fundamental tool to improve the efficiency of power grid asset management.