I agree with the people here who said it was better if the PLC never became elective, but I also think the Union of Lublin would be a perfect time to put the kingdom into a good path.
One big change would be the very first election. Just kept Charles IX of France alive and with sons, thus Henry Valois would remain at Poland his whole life. Just give him a son and a new dynasty would remain. After all, the Capets were usually good at centralizing and reforming their states, no matter the place they were, and there are many examples of this (Anjou Hungary, Anjou Naples, Anjou Albania, Valois Burgundy, Bourbon Spain, etc.).
The problem was that Henry leaving the polish throne just a few months after being elected actually damaged the credibility and prestige of the newborn state and set a precedent of having a powerful nobility at the expense of the king in charge. If you avoid that, you are set to a good start.
Or the other option is Charles IX dying earlier and Ernest of Austria is elected, instead. Habsburg were not as good as Capets at centralizing their domains but they were usually very capable on their own. Just make him start an Habsburg branch there and it could survive way into the 1700s.
A third option, and almost never considered in this place, is Albert Frederick, Duke of Prussia, and actually a descendant of Casimir IV Jagiellon (I think the last one of them).
He would be a good option considering he is a "native" ruler familiarized with the geopolitics of the region. The problem was that he left no adult sons and he started to suffer from a mental illness at the time of the first PLC election, so yeah, not much of an attractive candidate, after all.
Either he keeps his sanity in check or give him a brother who is more capable than him and you get the perfect, and totally neutral, candidate for a future dynasty of the PLC.