As we shall see, applying LES for ML DFT involves two key challenges: (i) for LES we need energy densities (energy contribution from a given point in space), which are not uniquely defined in DFT and (ii) generating accurate correlation energy training data for machinelearned DFAs. Our methodology to address these challenges, along with an overview of the work presented in this paper, is summarized in Fig. . In Fig. (a), we show a labeled overview of the methods developed and used here, linked to both (i) and (ii). We solve (i) by adhering to a mathematically and physically sound conventional DFT gauge for correlation energy densities de-rived from many-body wavefunction theory . We solve (ii) by building a proxy reference for these correlation energy densities within this gauge and efficiently implementing them to enable us to train our ML energy densities. This proxy reference energy density is built by combining second-order perturbation theory (PT2) [magenta circle in in Fig. ] and the specific PT2 regularization [blue square in Fig. ], which is crucial for making our proxy reference sufficiently accurate. We implement a numerical data generator of this proxy reference energy density leveraging modern Python libraries (e.g., JAX ) to simulate closed-shell systems within a spin-restricted formalism. New input features tailored to the problem, such as Grimme's real-space electronic correlation measures , enable us to construct a robust neural network for these correlation energy densities [Fig. ]. We then contrast the transferability of our LES strategy with the common global energy loss (GES) that adopts standard 1 system = 1 energy data point approach [cyan and maroon diamonds in Fig. ]. Keeping other factors in the DFA training the same allows us to isolate how the transferability is affected when we move from GES to LES [Fig. ) shows how the two models trained on small atoms perform on the dissociation curve of BH within spin-restricted calculations].