My question is this: how is a flange defined? Is it the very furthest forward part of the body's lens mount? Is it related to the back element of a lens? Is it dependent on the actual shape of the lens mount?
It is the flat, machined part of both the lens and the camera that mate to one another at an established distance from the camera's imaging plane. With most current mounts, it is fairly easy to see on the camera as the flat metal ring that surrounds the opening in the front of the camera, properly called the throat.
The front surface of the widest, flattest part of the metal ring of this Panasonic GH4 camera is at the correct 19.25mm distance from the plane of the image sensor.
There may or may not be other points of contact (levers, screw drives, lugs, etc.) on the camera that are forward of the flange. Most mount systems have lugs on the lens ring that extend past the flange and engage lugs on the inside of the camera's flange ring.
This screw mount type of lens shows threads that extend well into the camera body. The flange distance, or registration distance, is measured from the flat flange ring on the back of the lens.
The back of a Canon EF mount lens. The exact flange distance is at the flat top of the two concentric ridges on either side of the serial number and the screws that secure the flange ring to the lens. When the lens is twisted onto the camera, these two raised ridges are pressed tightly against the wide, flat flange ring on the camera which is very similar to the one pictured above (other than the fact that on Canon EF cameras, the ring is 44mm in front of the imaging plane).
The back element of the lens may be either well forward of the flange, typically for long focal length lenses, or extend past the flange and into the camera as is sometimes the case with shorter focal length lenses.
This Nikon F-mount telephoto lens has a rear element that is nowhere in sight from the rear of the lens as it is placed well forward of the mounting flange.
On the other hand, this Nikon F-Mount lens has a back element that is well past the mounting flange (also the flat top of two raised concentric rings on either side of the screws holding the ring to the back of the lens body).