This paper presents a physics-informed online learning method that approximates the stator flux linkage model for synchronous machines (SMs) using neural networks (NNs). The approach trains the neural networks through optimization by minimizing the residuals of the governing equations of SMs, while considering the physical constraints inherent in the flux linkage model. The flux linkage obtained through the proposed method can be utilized to the state estimation or parameter identification for SMs. The proposed online learning method is verified through MATLAB simulation results obtained using a 35-kW IPMSM.