The complexity here depends on the exact behaviour you want.
If you want the whole object to blink out when it enters the cube, then just make the cube an Area, and use the collision to drive a
is_inside bool. Send this in as a uniform, let it drive the alpha and job done.
Another way that makes only the parts of the obj that are inside the cube transparent is to send the cube's origin in as a uniform, calculate the cube and set alpha accordingly. I'd start with a sphere as it's much simpler.
Two further approaches that I'm not certain about: 1) viewports projected on sides of cubes (like the Portal 2 method) 2) It might be possible to use passes. Not sure.
I'm also not certain about alpha and shadow behaviour. Try it and see.