From Noise to Narrative: Tracing the Origins of Hallucinations in Transformers