I have a 2009 legacy, and replaced one of the front wheel bearings/hubs late last year.
On my car, there are 4 bolts that hold the wheel bearing/hub to the knuckle, it doesn't need to be pressed in. It can be difficult to remove the wheel hub and brake dust shield from the knuckle if rust is present, but the wheel hub should just slip into place once everything is cleaned up.
It's good that you found a knuckle with an oem hub, some subaru owners report cruise control issues with cheap aftermarket hubs. My guess is that the cheap aftermarket wheel hubs use less, or lower quality magnetic materials, and the wheel speed sensor doesn't get a good reading on them.
On 2005-2009 legacies, it is very common for the "pinch bolt" above the ball joint to break when trying to remove it, outlined in red below.
Since you have a whole new knuckle, breaking that bolt is less of a concern. It wouldn't be a bad idea to have a new bolt on hand though if the new knuckle doesn't come with one. That bolt is a funny length, but you might still be able to find one locally if needed.
You could also remove the castle nut and cotter pin on the bottom to remove the knuckle, but then you'd still have to wrestle with the pinch bolt to get the ball joint out, or just buy a new ball joint too.
As far as the axle nut goes, I just took the nut right off and didn't bother trying to unstake it. Though with that said, I was also replacing the whole axle, and had a new axle nut ready to go. You could try to unstake the nut, it might just be less off a hassle to buy a new axle nut, I forget how much they cost though. The wheel bearing should hopefully slide right off the axle from what I remember, I don't think mine put up much of a fight.
It might be tempting to tighten the axle nut down when the car is on the ground to make things easier, but you should do it with no weight on the hub to avoid damaging the wheel bearing, just have a buddy hold the brake pedal down.
Same idea (no weight on bearing) goes for loosening/removing the axle nut, but this is not a concern for you since you're replacing the wheel bearing/hub.
*After looking at that picture above for a second time, I would definitely plan on that pinch bolt I outlined breaking. When I went to remove that bolt on one side, I went right in without the knowledge that it is prone to breaking, and broke it right off the bat.
The second time around on the other side of the car, I hit that bolt with pb blaster for a week straight, and it still broke when I removed it. I've never used heat before to help remove a rusted bolt, so maybe that is how a technician would remove that bolt without breaking it.