When a creature you can see casts a spell, you can attempt to retain its arcane pattern. As an action, you can make an Intelligence (Arcana) check (DC 10 + the spell’s level). On a success, you may record that spell for potential transcription.
During a short rest, you can add a number of spells recorded this way to your spellbook equal to your Intelligence modifier (minimum of 1). The spell must be a spell of a level you can cast. Adding a spell this way does not require gold or additional time.