Functional bases for transversely isotropic and transversely hemitropic invariants of elasticity tensors