Intermolecular potential energy

If by intermolecular energy you mean the pairwise energy between atoms
that are in different molecules (excluding intramolecular pairwise energy).
then you can do this.

Run your simulation and save snapshots (dump command).

Then process the snapshots using the rerun command.
Define the same pair style as before. But use the neigh_modify exclude molecule/intra

option to remove pairwise intramolecular interactions. What remains
will be the intermolecular energy.

Steve