2D and 3D topological field theories for generalized complex geometry