I’m going off the top of my head, but if I remember correctly you can put all objects/collections into 1 collection or set all collection individually. All objects should be put in to a collection. Then in outliner click funnel icon and click the square with a circle cut out of it’s center. This is the holdout option. If you used a master collection then click this icon next to that collection. If you are using multiple collections then click that icon for each collection. This makes all objects in the collection a mask/alpha shape. Then under rendering tab->film panel->check transparency. Then you can render out a moving matte. You can switch to eevee, but if the final render(aka the beauty pass as you call it) is in cycles you may get some anti aliasing artifacts. There is also another method using material override, but I don’t remember where the setting are.