How to find the energy of a rect signal?
Here's a definition of the energy of a signal from Wikipedia: https://en.wikipedia.org/wiki/Energy_(signal_processing)
For your specific signal, I recommend to draw the original signal and then the transformation. Finally, just calculate the squared magnitude and the area under it.
These are plots of the steps I mentioned (from Matlab):

As you can see in the last plot, the energy is basically the area under the rectangle, which is in this case 4*4=16.