I assume that the 10 GB limit in your case is due to that you are running SQL Server Express, which caps the database size of license reasons. (It's after all free and still licensed for production usage.)
When you create a database, you can specify a max size for the data file:
CREATE DATABASE MySmallDatabase ON
(NAME = 'MySmallDatabase',
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL16.SQLEXPRESS\MSSQL\DATA\MySmallDatabase.mdf',
MAXSIZE = 2 GB)
You could also have a DDL trigger that fires on ALTER DATABASE to change the max size.
But I am not sure that this is a good idea. I suspect that will happen is that when you reach the limit, you will get a "file full" error, and your application may not react, because it's only looking for that 10 GB limit.