There are a couple of options.
One: make the outfit have techlevel 999, so that it can never be purchased or sold, because it never shows up in the outfit shop.
Two: Set the "can't sell outfit" flag (that's 0x0008). This will allow the player to purchase the thing, but not sell it. If you also set the max number of the item to zero, the player will not be able to purchase or sell the outfit, but it will appear in the outfit shop. This may only work in EVO 1.0.2 - I haven't checked for backwards compatibility on this.
However, you can't make it so that if the player is in one ship the outfit can be purchased and sold as normal, while if the player is using another ship, the outfit can't be sold, unless it's actually two different outfits - and having two different outfits doesn't work with weapons or ammunition, so that probably doesn't help you much.
------------------
(Insert Signature Here)