After you meet the mother worm in the mine, there is a room to the left with a computer that you need to enter in order to get the game cartridge from the small worm.
Once you have the game, head back out of the mine, leave the beach, and take the train back to the forest. Then, head up the elevator, go just a little right, and jump up into the cabin with what looks like a Space Invaders logo on the door.
From there, you can use the cartridge on the TV to play the game. The tricky part is getting 999. Here is a video as an example:
All credit to Mr Splash.
Edit - If you got the game cartridge, then finished the story before playing the mini-game, you can still select 'continue', and make your way to the forest.
In other words, you wouldn't have to start a new game.