Learning Energy-Based Representations of Quantum Many-Body States