Intersection invariants in arbitrary 4-manifolds