Interacting selectively and non-covalently with a regulatory transcription factor and also with the basal transcription machinery in order to modulate transcription. Cofactors generally do not bind DNA, but rather mediate protein-protein interactions between regulatory transcription factors and the basal transcription machinery.