long pokemon lore, some speculation
Pokemon Diamond and Pearl, DS: Introduction of a character named Looker, a sort of goofy and bumbling but competent when he needs to be, secret-agent type. We don't get a lot of info.
Pokemon X and Y, 3DS: There is a plot-important event 3000 years ago that released so much energy that it's implied to be what caused Mega Evolution to be possible. Also some references to it causing a possible timeline split. There is a postgame storyline that involves Looker. I'll note that he knows exactly what's going on during this story, which will come up in a bit. Note that in every future game so far, Mega Evolution has been possible, but it wasn't in any previous game.
Pokemon Omega Ruby and Alpha Sapphire, 3DS: These are remakes of Ruby and Sapphire, but it's extremely important to note that they do not have a Battle Tower. There is a postgame storyline that involves an asteroid that threatens to destroy the planet. Scientists are looking into ways to protect the species, and one solution they've come up with is to use a device called a "Link Cable" to transfer the asteroid to a parallel timeline. However, the timeline that it would be sent to is less advanced scientifically and would certainly be doomed. Note that a "link cable" is how GBAs talked to each other in the real world. Also in the postgame, you can run into Looker. He has amnesia. He says he woke up on a beach with no memories at all, and was given a home by inhabitants of the island.
Pokemon Sun and Moon, 3DS: Shit gets absolutely wild.
The plot of the game involves "Ultra Beasts", which are explicitly stated to not be pokemon but in terms of game mechanics they absolutely are, so you can just think of them as alien pokemon. They come from an alternate dimension known as Ultra Space. At one point during the plot, you are taken to Ultra Space to fight one.
In the postgame, there's a storyline where you work with Looker, who's back to knowing who he is. We find out that the organization he works for is called the International Police, though they still seem to be much more like secret agents than cops. You work with him and his partner, Anabelle, to capture Ultra Beasts that are invading this reality. There are occasional lore drops, including the fact that they've appeared before. In fact, Interpol has discovered that Ultra Beasts are drawn to people who have traveled through an Ultra Beast's wormhole, who have been nicknamed "Fallers". Of course, during the main story, you became a Faller. They plan to use you as bait to set a trap for the final Ultra Beast.
This is also how they dealt with the Ultra Beasts the first time, with another Faller: Anabelle. They don't know where she came from, but they found her coming out of an Ultra Beast's wormhole.
On a beach.
With no memories.
Quietly mumbling about a "Battle Tower".
Additionally, there's an area called the Battle Tree where you can fight many NPC trainers who don't appear as battles anywhere else. If you're lucky enough to get Anabelle as an opponent, you'll discover that she is the only trainer in the entire game with a battle theme that uses the original Ruby and Sapphire soundfont.
So, here are the conclusions I've drawn:
The alternate timeline is the timeline of the GBA/DS games, while the 3DS timeline is separate. The Looker on the beach is the GBA/DS Looker, and therefore a Faller. The X/Y and Sun/Moon Looker is separate. Anabelle is also from that timeline, which is why she knows about the Battle Tower. Ultra Beasts are taking characters from that timeline into this one, and we have no idea why, or what's happening there.