Illagers controlled with Totem of Possession won't attack other Illagers.
Illagers controlled by the totem of possession will not attack other illagers they collide with. However, they will attack non-illagers they collide into such as skeletons and zombies.
I tested this with Pillagers, Evokers, Vindicators, and Illusioners (which don't spawn naturally, but I wanted to test out of curiousity.)
Similiarly, I've also noticed that some mobs from other mods such as cataclysm will not attack mobs from their own dungeon when possessed, but will attack other mobs they collide with, including those from different dungeons.
https://files.catbox.moe/0xvwum.mp4
illagers cant attack other illagers no matter what
Illagers have a isAlliedTo() method. I've created a mixin which returns the method false if a illager is under possession. Will submit a pull request.