In this paper, we investigate the nonlinear electrostatic wave propagation in a two-dimensional magnetized plasma. The plasma consists of electron and positron components with relativistic degeneracy and stationary ions for neutralizing its background. Using the basic equations for this type of plasma in combination with the reductive perturbation method, we derived the Zakharov–Kuznetsov equation using the Lorentz transformation stretching method (LT). For the first time, we compared the results of the Galilean transformation stretching method (GT) and the LT method to investigate the effect of plasma parameters, such as the relativistic degeneracy parameter of electron particles (re0), the density ratio of ion to electrons (δ), and the normalized electron cyclotron (Ωe), on the amplitude and width of the wave solutions. The plasma parameters used in this research are representative of compact astrophysical objects. Numerical results showed that the amplitude of wave solutions obtained by the LT method is smaller than the GT method, but the width is greater. We provide a physical explanation for these differences. Furthermore, we present a physics-informed neural network (PINN) approach to directly recover the intrinsic nonlinear dynamics from spatiotemporal data. The PINN model uses a deep neural network constrained by the governing equations to learn the optimal parameters, with the aim of enhancing the predictive capabilities of the system. The results of this study provide valuable insight into the propagation of nonlinear waves in white dwarfs, where relativistic effects are significant. These findings could substantially advance the development of emerging machine learning applications in astrophysics.