Categorical Foundations of Explainable AI: A Unifying Theory