How can I create an object which masks and cuts into other objects?
Add a Boolean modifier to the cube you want to remove parts from. Set the operation to Difference and select an object that is used as volume to calculate the difference.
Then enable the Restriction Toggle for Disable in Renders (camera icon) for the same object that is used in the Boolean modifier for the Difference operation. This will hide it in the render. You can also hide it in the viewport in case you want to see the effect of the modifier right away as shown in the video at the beginning.

Once this is configured you can animate the objects. The cube will have parts removed without the other object being visible in the render.