The 5e rules are a bit vague on copying spells into a spell book, probably because on a Wizard has such a book.
A spell from a scroll, spell book, or memorized may be copied into a spell book (any spell book).
This costs SPELL-LEVEL * 10gp.
An arcane check is made for success. DC is 10 + SPELL-LEVEL. If failure, it requires a long rest before another attempt is made.
Scrolls which are copied are consumed.
Spells written from memory consume a spell slot of that level.