First-principles analysis for the multiplet structures of tetrahedrally and octahedrally oxo-coordinated 3d2 and 3d3 transition metals