This can be done throughout the campaign, in multiplayer, or in training, and is cumulative throughout. Note that firing on and hitting a magazine does not guarantee a magazine explosion. You can tell if the magazine exploded because there will be streamers that shoot off leaving smoke trails, somewhat like fireworks, along with a shockwave that expands out from the ship. If you don’t see that, no matter how big the explosion is, it doesn’t count for this achievement. Also, it is reportedly the most touchy achievement in the game and may take quite a few more explosions than the 20 listed, although this appears to be a problem restricted to the Xbox version of the game much more than the PC version.
The most simple approach is to load up the first Japanese training mission, select the dive bomber (D3A Val) and bomb the carrier’s magazine repeatedly. When it sinks, a new carrier will launch and you can keep going. In training, there is no return fire, so you won’t be shot down. As long as you don’t crash, simply repeat until the achievement unlocks. Note that you do not need to dive, you can drop the bombs from level flight and it will still count for the achievement. Also, you can use your machine guns to explode the magazine of the AK ships and that will count as well, but if you sink the third one the game will exit back to the menu and you will have to re-enter the session to continue.