He was forced to resign last August after helping the country 's successful transition to democracy , and has successfully resisted attempts by the civilian government to prosecute him for violating the constitution during his presidency .