Entanglement generation and quantum information transfer between spatially-separated qubits in different cavities