Highway Code Rule 239
"You
MUST apply the handbrake before leaving the vehicle"
This is law, so not applying it is an offence. Not sure how anyone would notice with an electronic one though. Unlikely to get caught unless it moves, or a bored copper notices.
Makes no sense with an auto that makes a physical lock in P, but that's been the law for as long as I can remember.
https://www.gov.uk/guidance/the-highway-code/waiting-and-parking-238-to-252
Using the handbrake frequently, every time you park, and every longer stop at junctions and traffic lights, etc., actually prolongs the life of the cables, by keeping them free and moving. Not using them promotes them seizing up.