This actually happened with Megatron in IDW. Visiting a mass grave essentially broke him, and he went on to save another universe under an evil theocracy, and then turn himself in to pay for his war crimes (The options on the table were execution, and his spark being extracted and sealed off permanently, so he could never move on to the afterlife.)