Over the last few years, machine learning tools have significantly progressed and attracted extensive applications in many parts of contemporary life. The power sector is one of the leading domains implementing such appealing and effective technologies for diverse applications as a part of the digital transformation of electric networks. A power system's low-frequency oscillation (LFO) is a non-threatening but slow-burning problem that might cause complete network failure unless adequately handled. This article proposes a state-of-the-art procedure of LFO damping in electric power networks via the sine cosine algorithm and deep learning (DL) technique. It uses two networks of power systems, in which the synchronous generator is fitted with a power system stabilizer (PSS) in the case of the first network; in the other, the synchronous machine is conjoined to the PSS that coordinates with a unified power flow controller. The proposal is developed based on the statistical assessment of the analyzed networks to improve the LFO damping via real-time adjustment of PSS parameters/variables. The proposed technique was evaluated using power system stability performance measuring criteria, such as the eigenvalue and minimum damping ratio. In the end, the effectivity of the stability-gaining procedure is also tested by time-domain simulation to implement in real-time. The study also dealt with a comparative investigation and discussion of the findings of some published works to conclude the capability of the proposed DL tool for stability improvement of the system in real-time by removing undesirable LFOs.