Step 1: get a CPH (County Parish Holding) number from Defra, Welsh Assembly, etc
Step 2: get a herd number from your local Animal Health office (above will give you the contact details)
As posted earlier, all movements of livestock have to be recorded (by sending the relevant forms - in this case the top copy of the AML 2) to your local trading standards. In addition, you have to keep your own movement book (whether a computer file or an actual book you write in), which records moves on and off, births and deaths.
Hope this helps. A bit of a nightmarish journey, I know. Why the CPH and herd number can't be dealt with in one place, nobody seems to know!
Good luck with the pigs
Liz