Transposable elements in mammals promote regulatory variation and diversification of genes with specialized functions