Learning Causal Semantic Representation for Out-of-Distribution Prediction