How can I change the desktop notification behavior?
This needs to be changed in your MacOS preferences:
Alerts stay on screen until closed. They do offer a Close button as shown here:
Banners dismiss themselves automatically after a couple seconds, but they do also give you a way to dismiss them manually. You need to click and hold the notification, then slide your cursor to the right a bit and release it, akin to a “swipe” gesture: