The Evolution of Neural Networks: From Perceptrons to Transformers