In fermenter (my preference,) I just dump in accepting that O2 will be inevitably introduced. But yeast activity will scavenge/ blow out the O2. I don't want to do it too early or too much aroma will be scrubbed out with fermentation gas out the airlock. I try to target when it's slowed down with just the last few points of gravity to go. Leave for the desired amount of time, if any, after fermentation is complete, crash and closed transfer. If I was going to do it in a keg post primary, what blatz said (although another method of separating the hops, like a stainless cylinder, would be fine for me. I use them in fermenter so I can harvest yeast.)