Tracing the Roots of Facts in Multilingual Language Models: Independent, Shared, and Transferred Knowledge