Quantum entanglement in physical and cognitive systems: A conceptual analysis and a general representation