If you're using chrome, you can go into chrome developer tools and go to the source tab. From there you can pause browser execution using the pause button at the top. Wait for the notification to appear and then pause the browser so it doesn't disappear on it's own. That will let you take your time to observe the html and decide on a css selector that adequately targets it.
Once you have your css selector you can approach the problem like this:
// Lets pretend that the css selector you want is a classname called "notification"
By css = By.cssSelector(".notification");
WebDriverWait wait = new WebDriverWait(driver, 30);
// throws TimeoutException if it doesn't become present after 30 seconds.
// Assuming it appears, it returns a WebElement for further use,
// otherwise null.
WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(css));
// throws TimeoutException if it doesn't become visible after 30 seconds
// throws TimeoutException if it doesn't disappear after 30 seconds
This example will give you 30 seconds of flexibility for the element to enter different states, appearing, displaying, and disappearing. You can perform actions in-between these to deal with each specific state. Or catch the exceptions to react to them if they fail. Hope this helps!