Basic curvature and the Atiyah cocycle in gauge theory