Emergence of novel functions in transcriptional regulators by regression to stem protein types