A general model-based causal inference overcomes the curse of synchrony and indirect effect