It's likely both mount and rider should provoke attacks of opportunity for the mount's movement
"Mounted combat is underdetailed in Pathfinder," says Pathfinder creative director James Jacobs. "So, the more you get into it, the more you're going to have to house rule." Whether mount, rider, or both provokes attacks of opportunity for the mount's movement is, however, one of the things that'll probably be gotten into quickly by any rider astride a mount, but the Pathfinder printed rules are absolutely gray on the matter.
With that in mind, despite some hiccups, mounted combat in Pathfinder does remain largely unchanged from mounted combat in Dungeons and Dragons 3.5. Because official Pathfinder material seems less than anxious to clarify exactly how mounted combat works, this GM thinks it acceptable to look to Dungeons and Dragons 3.5 for answers.
Monster Manual author Skip Williams's Rules of the Game Web column "All about Mounts (Part Two)" on Attacks of Opportunity says
When you and our mount move, you both are subject to attacks of opportunity from your foes (your mount might be the one actually doing the moving, but you're moving as well). For example, when you and your mount leave a threatened space, you both provoke attacks of opportunity from foes that threaten that space. A foe who can make multiple attacks of opportunity in a round (for example, a foe with a high Dexterity score and the Combat Reflexes feat) can make an attack of opportunity against you and one against your mount.
As an optional rule, you might want to treat a rider and a trained war mount (or a special mount, such as a paladin's warhorse) as a single creature in battle. When the pair moves, they provoke one attack of opportunity for each foe that threatens them, not one each.
(Emphasis mine.) This reader is unaware of this bold statement being made elsewhere by any D&D 3.5e or Pathfinder designer. The topic has been discussed on the Paizo messageboards in, for example, 2010, 2013, and 2015, but no designer's offered input.
So, despite a lack of clarity by either set of printed rules on the issue, one designer believes that mount and rider both provoke attacks of opportunity for the mount's movement (unless using that designer's optional rule). As Pathfinder's rules are relatively silent on this specific score (although, as ShadowKras's fine answer demonstrates, meaning can be inferred and extracted from the existing rules), William's absolute ruling seems a reasonable one.
(It should be noted that the Rules of the Game Web columns were in some quarters poorly received and, sometimes, dismissed entirely… yet the "All about Mounts" series remains one of the few places in the whole of Third Edition—and, subsequently, Pathfinder—that reduces instead of increases the opacity and unrelenting sorrow that is mounted combat.)
"So that's what Ride-by Attack means!"
Using Williams's rules, for example, in both D&D 3.5e and Pathfinder, when the feat Ride-by Attack says, "You and your mount do not provoke an attack of opportunity from the opponent that you attack," the feat's benefit means that normally both rider and mount provoke attacks of opportunity in the given situation instead of meaning, for example, that normally attacks of opportunity are provoked by one or the other of the rider or the mount, nobody really knowing which.
Easiest to treat this as 'Difficult Terrain' for flying movement
Although D&D's round abstraction isn't meant to be completely realistic: the dragon is launching itself from a moving platform, so it could believably even be ahead of the flying ship briefly before landing again (assuming a winged creature the size of a cottage is believably airborne to begin with)... similar to how someone could say, jump 20' forward while on a flying ship without worrying about their jump speed compared to the ship's speed. It's just in the dragon's case: it has some serious wind resistance to contend with (not unlike flying around in strong winds)
Treating this as difficult terrain for flying would be a simple (and supported) method that would halve the distance the Dragon could fly without losing its 'ride' (i.e. something it should probably be able to do briefly). And of course: if it doesn't land on its turn, the ship would move away.
But let's explore a different example: say a melee fighter wants to jump off a very-fast moving wagon, attack someone, then jump back on before the wagon leaves. The DM might decide to use the mounted combat rules as a basis for adjudication:
"Once during your move, you can mount a creature that is within 5 feet of you or dismount. Doing so costs an amount of movement equal to half your speed."... which could make the stunt pretty unlikely without further allowances.
Best Answer
Lose the battlemap entirely . Use a whiteboard & be more generalized with things like distances & size once the grid is gone. If you're fighting in a huge warehouse district with streets around most buildings. You don't need to illustrate every single building/street.
Don't try for tactical, go for things like "pretty far down the street a car makes a sudden screeching turn pulls down one one of the side streets". The non-exact nature allows the mental theater you mentioned to color in some of the details as the combat evolves. If something happens like a building getting blown up to make some difficult terrain, you have difficult terrain anyplace that seems reasonable instead of "these three squares". Let one of your players manage the whiteboard so you can be free to focus on describing things.
With the grid out the window, a whiteboard in its place, & a player manning the dry erase markers/eraser, the mental theater can spring to life & with the exact dimensions lost to general terms the players stop thinking of movement like chess in favor of describing what they want to do to really add some fire to that theater. If I'm facing off against a rocket launcher with a range of X feet while in my tshirt with a stick, I'm not going to stand at X+1 feet & neither should your players going fuzzy with distance will make it so they stop trying and go with things that play out better in the mind for what they mean from the player's perspective than what they can see from their external godlike view of the situation as a player.