Hi,
The MP4 format does not by itself support transparency so you may need to use a format like webp.
For some approaches you can... and perhaps should... render out to a format such as PNG with transparency and then convert that image sequence to the final format.
The gif format supports transparency through use of a key color (as opposed to an alpha channel/matte) and that can be an option for short or small animations.