Ring 789 from your Virgin handset and select the "I'm thinking of leaving" option.
You will be given an automated message telling you the earliest date that a new upgrade can commence. If you want to run your "contract" for the minimum term and then end it immediately afterwards, you need to let Virgin know at some point during the 30 days before the date specified on the recorded message.
It is not advisable to leave it towards the end of the acceptable date range, especially if you want to take your number with you.
If you speak to someone in retentions who is adamant that you need to give 30 days notice (which is incorrect advice) just direct them to this post by a Virgin employee, clarifying the situation.