Large language models replicate and predict human cooperation across experiments in game theory