BPS states meet generalized cohomology