When there's as much bias as there is in the SC, nothing without precedent is certain. Even with precedent it's not iron-clad but would be unlikely.Of course they can impeach after office. Otherwise the president could just do whatever he wanted during the last day's in office.
Also there is precedent in that former state officials have been trialed after leaving their position.
What states have done is under their own law. Whilst that's interpreted from federal law, it's not dispositive at that level.
The only case at federal level is someone (not a president) who retired hours before being impeached so that he could run again immediately after. But that was ruled the way it was because of the retirement. It's quite a sparse section of law as far as precedent is concerned.