Energy is neither created or destroyed, assuming you are running your simulation in NVE and you live in the same universe as the rest of us. So of course the energy doesn’t change. You might think about looking only potential energy but that is not without its own set of problems.
The best tool for solving your problem is to use your own brain and understanding of physics, before asking such general questions to the forum. Take 2 steps back and rethink. For example: ask yourself if “I was in a laboratory, how would I measure the Young’s Modulus?”
You would put a sample in the tensile tester and measure the force as a function of displacement, convert to stress and strain and take the initial slope of the loading curve, right? Just figure out how to do the same thing in your lammps script. When/if you get stuck writing this script you can ask specific questions.