Either way, just matters on money. You basically have 4 options
1) Stock replacement. Usually costs ~$500 in parts and $1000 in labor. No added strength
2) Better gears, everything else stock. Usually costs $1500 in parts and $1000 in labor. Doesn't add much strength. Good for 02-07 WRX's that will only do small bolt on mods or small turbo upgrades.
3) Full transmission upgrade. Labor here is very hard to do on your own. Total cost here is $3500-$6000. Usual options are something like a PPG gearset which includes casing modifications, often upgrades to the diffs as well.
4) Replacement, usually USDM 04-11 STi 6-speed. More expensive than it seems, the STi is a sufficiently different car in terms of driveline that this requires several additional pieces not the least of which is the entire rear end of the car's driveline to also be swapped. General cost is $6000-$9000 mattering on the donor's condition. The STi 6-speed is considerably stronger than the stock 5-speed, but it's been argued that a proper built PPG 5-speed upgrade may be even stronger than the 6-speed. The gearing on the 6-speed is also extremely short, and most people will prefer a longer set of ratios possible in a custom built 5-speed. The main advantage of the 6-speed is it's ease of drivability and durability for general/normal driving. Not an extreme solution in other words despite the cost.
If you build some 500whp+ monster, then you'll be looking at a more custom built transmission and diffs based on either the stock 5-speed or the 6-speed. The 5 is more flexible, more shops provide options. The 6-speed is stronger so gets messed around with less.
04 STi 16G powered lagless fun
04 WRX: SOLD