Causal Reasoning through Two Layers of Cognition for Improving Generalization in Visual Question Answering