The Animal Welfare Act 2006 makes it an offence to cause unnecessary suffering to any animal.
More specific requirements for pig welfare are set out in the Welfare of Farmed Animals (England) Regulations 2007, which focus on the detailed conditions pigs must be kept in.