Marcus Rashford has said he considered leaving Manchester United before manager Erik ten Hag arrived and provided him the "freedom" to unlock his potential at Old Trafford.