It's up to the DM.
The target of Tenser's transformation is the caster; in some sense, the caster is the only one affected by the spell. But we can also make the case that the spell is affecting a target hit with a weapon attack. It is unclear which of these is correct.
Jeremy Crawford gave his unofficial ruling on twitter, ruling that the Rakshasa would not take enhanced damage from spells like shillelagh and magic weapon:
Shillelagh and magic weapon are spells. Limited Magic Immunity prevents a rakshasa from being affected by spells of 6th level or lower, unless it wishes to be.
If you choose to rule similarly, we should observe that not all of the effects of Tenser's transformation are affecting the Rakshasa:
- You gain 50 temporary hit points. If any of these remain when the spell ends, they are lost.
Obviously the caster having temporary hit points does not affect the Rakshasa.
- You have advantage on attack rolls that you make with simple and martial weapons.
This one is tricky, but I have ruled that we still have advantage on attacks against the Rakshasa. We have advantage because of something affecting us, not because of something affecting the Rakshasa.
- When you hit a target with a weapon attack, that target takes an extra 2d12 force damage.
This one seems to directly affect the Rakshasa, though it seems just as reasonable to rule, as NautArch did here, that the effect is on something else, and it isn't a direct effect on the Rakshasa.
- You have proficiency with all armor, shields, simple weapons, and martial weapons.
No affect on the Rakshasa, so this one remains unchanged.
- You have proficiency in Strength and Constitution saving throws.
No effect on the Rakshasa, so this remains unchanged.
- You can attack twice, instead of once, when you take the Attack action on your turn. You ignore this benefit if you already have a feature, like Extra Attack, that gives you extra attacks.
We get an extra attack because of an effect on us, not the Rakshasa, so we should still get the extra attack, even against the Rakshasa.
Whatever you rule, do so consistently. As Dungeon Masters, we should seek to set consistent expectations in our rulings as much as we can, so that our players can make decisions based on good information.