How can they convict a person for acts done when he was president?
Because a president isn't a dictator. Laws still apply to them. A president can be charged, after leaving office, for illegal things they did while in office.
Yes, you tried your best to implement a Stalinist system where all members of DerParteiRepublikkan are above the law, but you failed. Therefore, your heroes are getting charged with the crimes they committed.