Though battle grids are often two-dimensional, the game world isn't! Sometimes you might need to visualize a creature's space as a cube for flanking. For instance, if Dae is positioned underneath a flying cloud ray while Navasi is flying above the cloud ray using her
ultralight wings, they might be flanking it even if they're piled in an odd stack on your battle grid. And if Dae were riding an enercycle, they might be able to measure from farther off the ground than normal.
In these cases, it's usually best to have the GM make the call on who's flanking rather than trying to do meticulous measurements in three dimensions.