His only hope is the Supreme Court wins it for him, but I think that’s a massive long shot. If he’s officially lost the machinery of the state will remove him. At worst he’ll sulk and refuse to do the handover.
This is the best article on ways it could play out if things are close/Trump refuses to concede. Long but good. Personally I think if the election doesn't look especially close, many of Trump's allies in government will abandon him quite quickly, but don't underestimate the number of Republicans who will stay loyal to him for the simple reason that the rank-and-file adore him. Watch out for an absolute massacre in terms of Trump's cabinet between the election and inauguration - if Trump thinks he can get an edge by replacing the Defense Sec, FBI Director or even AG, he will do it (he hates them all anyway).
The post-election pardon stuff is an interesting one - strikes me as the kind of thing Biden would be up for whether it was a condition of Trump conceding or not. May well be the smartest thing for the Dems long-term - would be catastrophic for Biden's short-term popularity, but he's only ever going to be a one-term president anyway (if that).