Funds transferred out of pension schemes almost tripled to a record £34.2bn in 2017, according to figures from the Office of National Statistics (ONS).