Sit the gammon in a large pot with the onion, bay leaves and vinegar. Pour over enough water to completely cover the gammon. Bring to the boil, then simmer for 45 mins. Remove the gammon from the pot and allow to cool.
Once cool enough to handle, carefully cut away the skin, leaving a layer of fat attached. Pat the skin dry with a clean tea towel, then transfer to a wire rack and leave to dry out completely.
Heat oven to 180C/160C fan/gas 4. Line one small roasting tin with foil and two small baking trays with baking parchment. Put the gammon in the foil-lined tin, fat-side up, and rub all over with the mustard, then the sugar. Put the skin onto one of the baking trays, then place the other piece of parchment on top, followed by the second baking tray. Find a weight to go on top (a heavy pan works well) then put both the gammon and skin in the oven. Roast for 30 mins, basting twice, until the gammon is golden.
Take the ham out the oven and turn it up to 220C/200C fan/gas 7. Continue cooking the crackling for 10 mins until it is deep golden and crisp. To serve, carve into slices and break the crackling into shards to serve alongside.