The four most used notifications are "error", "warning", "success" or "info". (usually colored red, yellow, green and blue)
For "error" and "success" we take for granted that the user has started a process on the page before the notification triggered. Thus we can also assume that this notification will never be crawled, no matter how you've implemented it.
The other two: "warning" and "info" on the other hand could trigger if someone has started a process, and you want to hold their hand a bit before the final step. (before something irreversible happens).
If your site has a crawlable page halfway through a process where you would like to add a notification, chances are you'd actually want the notification to be crawled, as it should "always" be relevant to the rest of the content on that page. However the notification text would then rather be placed next to the button or the active interface control where it would be relevant. (i.e: rather as help text, than a notification).
So, in conclusion:
If you have very special needs where these notifications need to be hard coded into the html because you want them to be crawled, just add them to the html.
If the events that trigger your notifications only happen to users (not serps) just add them to the html, as they will never be crawled anyways.