You are on the right track, tasks should be stored in the SQLite database, which you should find in the Nextcloud data directory by default (data/ from the Nextcloud document root or e.g. /var/www/nextcloud/data). The database file should be named nextcloud.db.
The name of the SQLite database is actually owncloud.db. You should find it in Nextclouds data-folder as @j-ed wrote.
Once you found the database you could easily export the tasks with the script calcardbackup. Have a look the section „does this also work with a broken instance“ in the README of the repository for how to accomplish this.