Three tiers of computation in transformers and in brain architectures