The timing of Kerry's actions, that I've seen, is vague. If Kerry did this while in office he was betraying a US ally to their enemy. If Kerry did this after Trump took office it would have been a gross violation of the Logan act, though not treason by the Constitution because the US is not officially at war with Iran.