Visible and near-infrared observations of interstellar comet 2I/Borisov with the 10.4-m GTC and the 3.6-m TNG telescopes