One (of many) important skills in Dominion, as in a lot of games, is being able to win the won game with as high a probability as possible. Little feels worse than letting a game you were way ahead in slip through the cracks. Giving advice on this is generally very difficult for Dominion, as every board is different, and every situation is different. There are, however, some general pieces of advice to give, and then some examples to demonstrate good lines of thinking.
Be alert for ways to end the game
This can mean grabbing 50% of the VP, setting up an unbreakable pin, emptying Colonies, or emptying Provinces. These are things to be aware of, of course, but in general people are pretty good about looking for them (though you do still need to be vigilant, as they are missed sometimes). The bigger thing, though, is looking at 3 pile endings. You want to know what piles are low, how many, and what ways there are of emptying them as fast as possible. Keep an eye for gainers, especially multi-gainers, like Stonemason and Procession. Also keep an eye on Curses, Ruins (especially with Death Cart), and Estates.
Generally be aware of how close the end of the game is
You need to know whether you're planning for a long game or a short game. Missing wins is a common mistake that people make, but probably even more common is people panicking and going for points too soon. "Piles feel low" can make people scared. You need to be concrete. How low are they really? Are they actually going to be emptied? If it isn't going to be in one turn, can your opponent realistically make the play to go after them over multiple turns, or will that hurt their deck too much? Sometimes the answer is, yes, they can go for it. But lots of times, they can't really. How much you want to play around having a bad turn or two is a function of how reliable your deck is and how far ahead you are.
Know your role, and leverage your advantages
Are you ahead because you have a very large points lead that is going to be hard to overcome? Or is it because your deck is much better? When the former is true, you want to make sure that your opponent can't build up enough of an advantage in deck to overcome that. Generally this means you want to try to make the game short, though sometimes you keep your deck at a quality where you can still win the long game. Still other times you'll seek to 'cut their legs out' by attacking the piles they'd need for a comeback, which inhibits their ability to build (though I should warn that this is quite rare). When it's the latter, you want to make sure that this advantage will have the time and space to be developed and played out for your advantage. So play for the long game, and make sure you don't lose short. Of course, the most common way to lose short is by letting the game end short - and so you want to make the game go long, by not blitzing down the piles.
Ask yourself: How am I losing this game?
This is really the banner under which all the other things lie. Even the Penultimate Province Rule is just a piece of this line of thinking. This is the most difficult piece of advice to give with specificity. It varies very much from board to board, and from game to game. But when you're ahead, you need to know why you are ahead. What is it based on? And why is that important? You need to make sure that you try to make your advantages are important, and try to make sure that any advantages your opponents have are not. And look to mitigate the ability for a bad shuffle, or a perfect shuffle from your opponent, to knock you down. Sometimes that means building consistency. Sometimes it means just ending the game as fast as possible.
One final word of advice before I switch to examples: make sure that in your attempts to secure your position, you aren't losing so much time trying to be safe that you let the core of your advantage slip.
Now, on to examples!
In this game, if we look at the position after turn 25, I have a superior quality deck. The way I lose the game is... to let that deck deteriorate. It doesn't take very much to lose reliability. I need to start sending lots of junk over, and I need to up my economy so I can by colonies, but the biggest thing that can shoot me down is losing my consistency - and so my Soothsayer, despite accomplishing the first two goals, is actually quite a bad purchase. If I sanely buy a gold, work my way up in money, and just buy a curse at some moment, I would have had plenty of time to set myself up without my deck ever getting too big. The way I played, I still had reasonable chances, but I gave myself way more chances to lose than were necessary, and it bit me.
This is a pretty classic Golden Deck game. I get myself set up on turn 11 or so. My opponent still has a little cleaning up to do, though at the precise moment he has a little tiny lead. Throughout the rest of this game, I just pound the Platinum into submission. The point here is that this way, my opponent simply has no counterplay, and the longer the game goes, the more non-perfect draws he will have, and I can continue my advantage. I could definitely have run the colonies out sooner, but there was just no need, as this way I extended my lead maximally.
Here we just look at the last turn. I have a small lead, and I am aware that 2 piles are out (Duchy and Market Square). I am in a good position, but there are of course lots of ways to lose - opponent can spike a Province or hit a Duchy, for instance. So while piling the Estates is very likely to lead me to a win, knowing that I can end it when I draw the Gold off Altar-ing my Overgrown Estate pays off - Death Cart and the ruins pile is a typical thing to watch for.
Another instance of pile awareness - here I lunge for the last curses
Here, an awareness of my deck lets me know I can simply go for it to end it on turn 9(!) by... running the Provinces! Key was knowing that the last card was a silver so that I could draw it up and Forge a Province for the win.
Another example of knowing that I can get the Provinces out.
Here, my trashing lets me build a pretty clean deck advantage over my opponent, with a reliable engine. I am able to catch up in points as well, getting me to the spot where I lead in all sectors. Then I apply the 'how am I losing this game' thought process. And the way I lose is to have my engine get unreliable - there is only one buy anyway, so extra money does nothing. Solution? Remake Silvers into engine components. This makes me super reliable, and I can take the points lead at leisure, only moving forward when safe and/or necessary.
In this game, I get out to what I believed to be a big lead. However, my opponent was massing Governor pieces. Despite it being a Colony game, I asked myself how I was losing, and came up with my opponent emptying the Provinces. So I got 4 - my opponent doesn't have the capabilities to overcome me by catching up on Provinces himself, so after this play, I'm pretty comfortably in control.
Finally, a pair of Possession/Masquerade games. The key here is that, in both, the way to go is pretty clearly to get possessing your opponent set up, as the engines are good (this isn't always the case of course, but it is here). Given that, the way either player wins or loses is going to be... to stop your opponent from possessing you, at which point you can pretty much put the game away at leisure. Thus, when possessing them you make them pass... their possessions, first of all, then what lets them re-buy possession (usually potion), and only then their provinces. (Obviously, if the game is right about to end, you might have to make an exception).
In the first game, here, doing this efficiently nets me a quick resignation. But in the second, here, my opponent gives me many more cracks at the apple than necessary (which unfortunately for me, I miss on, but still, this is something to look at).