A direct transfer of your shares into a stocks & shares ISA or pension is not allowed. Instead you have to sell them and repurchase them within the ISA or SIPP.
This is called 'bed & ISA' or 'bed & SIPP'. The sale and repurchase are done immediately after each other to limit any exposure to the market.