G-Transformer for Conditional Average Potential Outcome Estimation over Time