Like Achromatic said, XY had a really dark story, such as a canonical death happening (which you pretty much never usually see given these games are targeted at kids) and Team Flare's goal is to wipe out anyone not aligned to them, which is pretty much genocide.
BW also had a pretty mature story, much more edgy than other games at the time of its release. But DPPt's one was also quite noteworthy given Cyrus wanted to destroy the world and create a new one. ORAS even made the Magma/Aqua plot more serious than in the original Hoenn games.
So yeah, Pokemon games have been getting edgier without some even knowing about it.