There are many, many ways to handle this, but the most straightforward is that you'll have to render out both elements as a seperate pass, using a useBG shader on everything else in the scene.
For example, say you have a blue ball and a red ball, circling around each other. You can set up one pass where the red ball has a usebg shader, a second pass where the blue ball has a use bgshder on it. This will effectively cut out a hole in the alpha where the other ball is supposed to be. You can also achieve the same thing by using the black hole setting on the shaders for the ball. (i think)
Lastly, you can render one pass with both balls in the scene, then render another pass with a pure red and blue shader, ambient color at 100%. Then you would take this layer into your comp app and tell it to use the solid colors as an alpha channel. This can be a nice fast way to generate several alphas at once.