Mesoscale eddies are a major sink of available potential energy (APE) in the ocean. When these eddies are not resolved or only partially resolved in a model, this effect needs to be parameterized to simulate a realistic large-scale state. Traditionally, the Gent-McWilliams (GM) parameterization has provided this sink of APE. However, the GM parameterization, which diffuses isopycnal heights, is not accompanied by a skillful prescription for GM diffusivity rooted in data from observations or models. Also, at eddy permitting resolutions, GM diffusion can negatively impact resolved eddies, and the only scale-aware prescription is to turn GM off in regions where eddies are permitted. Here we present a novel data-driven parameterization, as a substitute for GM, that extracts APE without overly negative impacts on the resolved flow. It is both flow-aware and scale-aware, and its magnitude can be tuned using an O(1) non-dimensional number. Features like non-dimensional inputs/outputs, lateral non-locality, flow-dependent coordinates, and range limitations improve the generalization of the data-driven scheme. Functional forms are learned via a small multi-layer perceptron, ensuring low computational cost and simple implementation in ocean models. The parameterization performs skillfully in offline evaluation, especially at scales smaller than the largest eddies. It is implemented in NOAA GFDL MOM6 and shown to be skillful in online tests in two-layer idealized simulations of a zonal channel and wind-driven gyre, at both eddy-permitting and non-eddying resolutions. This work suggests a path towards leveraging high-resolution simulations for the reduction of structural error and improvement in the fidelity of climate simulations.