Final boss: Adulthood.
In the last episode ever, one of Celestia's foreign ambassadors needs a new scholar, so Celestia offers the position to her most faithful student. Twilight recognizes that this is a great career opportunity and a way to put what she's learned about friendship to use, but on the other hoof, she's reluctant to leave Ponyville and her friends. Twilight asks for more time to think the offer over.
As it turns out, most of her friends simultaneously get similar job offers that will take them away. Rainbow Dash finally gets accepted into the Wonderbolts. Rarity gets a position with a glamorous studio in Canterlot. The Apple family acquires new land, and establishing a new orchard there is Applejack's responsibility. Fluttershy gets a position at a faraway zoo or nature preserve or something. Pinkie Pie strikes me as the one least likely to leave Ponyville (she already seems set up to take over Sugarcube Corner when the Cakes retire) but the plot works just as well if she's the only one to stay.
Twilight realizes that she and her friends can't stay together in Ponyville without depriving each other of once-in-a-lifetime dream opportunities. She writes back to Celestia to accept the position.
The mane six say their goodbyes, promising to write and visit each other as often as possible. Twilight is the first to leave, so the others see her off at the train station.
As the train pulls away, there's a voiceover of Twilight writing her final friendship report, not as a letter to Celestia, but as an entry in her journal. She writes that friendship is made of both meetings and departures. That, even though circumstances have scattered her friends to the four corners of Equestria, she'll always have the memories of their times together to treasure.
Across the world, thousands of pre-teen girls and adult men will bawl their eyes out
while the overly-cheerful end credits music plays.