Magnetic phase transitions in cupric oxide