The Role of Logic and Automata in Understanding Transformers