First, 'transfer theory' wasn't a paradigm or historical stage in the development of the field of Second Language Acquisition like Contrastive Analysis or Error Analysis was. Transfer is a phenomenon that occurs in the process of L2 acquisition, and that's something that any theory has to account for.
Contrastive Analysis takes the L1 and L2 grammars, scrutinizes them to make detailed comparisons, and generates predictions about transfer. That's how transfer fits into Contrastive Analysis. One of the reasons it fell out of favor is because those predictions often turned out to be wrong.
Error Analysis takes non-targetlike aspects of learners' production as the starting point of analysis. We now know that non-targetlikeness can come from a variety of sources - not only transfer but also various universal/developmental factors (such as processing/fluency issues). Thus, transfer fits into error analysis by being one source of the so-called 'errors'.