Apparently the US Navy does these semi-regularly to test the durability of warships
This is almost certainly what it was. Wiki even has a photo of the USS Gerald Ford undergoing blast tests off of Ponce Inlet, and mentions that it registered as a M3.9 quake: https://en.wikipedia.org/wiki/USS_Gerald_R._Ford#Operational...
If I had to guess, this is probably the USS John F. Kennedy: https://en.wikipedia.org/wiki/USS_John_F._Kennedy_(CVN-79)
They also periodically use live munitions on decommissioned ships, sinking them, for the purposes of validating all sorts of stuff.
https://www.pacaf.af.mil/News/Article-Display/Article/452930...
These are the full-ship shock trials, where they set off progressively closer charges to certify the hull and combat systems survive a near-miss. The tight scheduling and monitoring is largely driven by the marine-mammal mitigation requirements.