Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chains