First locate the sqlite files db and db-wal where notification reside.
As in mojave, could be found using this command:
lsof -p $(ps aux | grep -m1 usernoted | awk '{ print $2 }')| awk '{ print $9 }' | grep 'db2/db$' | xargs dirname
Then as @greenhouse mentioned, MacFronsics script is good choice to parse db file. As far as I test the script supports mojave as well.
In case someone fail to get latest notification, the most recent notifications are not likely in main db. Directly parsing db file would end up with old notifications. If you want latest notifications, remember migrate the record in db-wal(Write AHead Log) file to db first.