Before doing anything with the headgasket, check this first!
I may have an idea on what's going on here. It looks like the 98 Forester, like many Subarus, has two radiator caps. It has one on the radiator itself (which we would expect) but also one on the coolant expansion tank - which I believe is that big round thing towards the front of the engine bay, just left of the centerline of the car.
Subaru does a weird thing with this coolant setup, and if you have replaced any radiator caps recently then it could cause the system to fail - and the failure indicator is overheating. If you haven't replaced your caps recently, it's still possible one of them has failed and this is causing your issue.
Many people put new caps on and if they aren't careful, this will cause a problem. Here's why.
Subaru uses two different kinds of radiator caps: a 1-way and a 2-way. These caps will look almost identical, the difference is in how they function: the 1-way can only open in 1 direction (thus the name), to let pressure OUT. The 2-way...you guessed it, can open either way - to let pressure OUT, or can open under vacuum to pull air (or, in actuality, coolant) back in.
The easiest way to identify these different caps is to look at the bottom - the 1-way will look flat, the 2-way will look like it has a dome.
So here's the thing: the 2-way goes on the expansion tank ONLY. The 1-way goes on the radiator ONLY. It's designed this way so the radiator can vent excess pressure without sucking any air in. The expansion tank can vent pressure if necessary AS WELL AS let air in - this letting air in is what lets the coolant go from the expansion tank back into the radiator.
If you put a 2-way cap on the radiator (or accidently switch the caps), this will cause the system to malfunction, and coolant will not flow as expected. This can lead to overheating and thus too high pressure!
It's also important to point out that just about every single aftermarket radiator cap out there is a 2-way. This is because most coolant systems on cars only have the one cap on the radiator, thus it needs to work in both directions. Subaru has designed their system differently. If you bought an aftermarket cap and put it on the radiator, chances are very good that this cap is a 2-way, and could be causing you problems. Many people that mod their cars, especially by putting in new radiators, may not realize this and install the cap shipped with the radiator on the radiator, which is a no-no.
Check your caps. Find an aftermarket 1-way - or better yet, just buy a Subaru OEM 1-way from a dealer.
A note on headgaskets: typically when a headgasket blows, it doesn't force coolant OUT. Yes, it can cause overheating issues, which could then cause the coolant to blow. But it's a very easy check to see if you have a blown headgasket. Open up the expansion tank and/or radiator, start the car up, and shine a flashlight down in there. If you see any kind of bubbles, it's a good chance you have blown headgasket. If no bubbles, you may be okay. I would also check the oil. Do an oil change and look at the consistency of the oil. Coolant mixed in with oil will produce a milky, often light-colored oil mixture. It's called the milkshake of death.
So: before spending the money/hassle on a headgasket, check your radiator caps. Even if they are the original caps, I highly recommend buying new ones from a dealership (to ensure you get the correct ones, and be sure to put them in the correct spots) because caps can eventually fail. Try that first. It may save you a bunch of money. If that doesn't fix the issue, then at least you got some new caps out of it. Good luck!