In actions or proceedings by or against executors, administrators, or guardians, in which judgments may be rendered for or against them, neither party shall be allowed to testify against the other as to any transaction with or statement by the testator, intestate, or ward, unless called to testify thereto by the opposite party. If a corporation is a party, this disqualification shall extend to its officers of every grade and its directors.