Text this: Transferring structural knowledge across cognitive maps in humans and models