Entanglement and violation of the discrete symmetries in oscillating systems