A mathematical perspective on Transformers