Humans In Algorithms, Algorithms In Humans: Understanding Cooperation And Creating Social Ai With Causal Generative Models