Transportability of Causal and Statistical Relations: A Formal Approach