There are already reports of lag issues but they don’t quite match what I observe on my system, but maybe the issues are related.
On my system, Aseprite is pretty much unusable with a pen tablet by default. Drawing lags behind a couple of seconds as well as everything else (creating layers/frames, undo, etc.).
But there is something interesting going on that may help you debug the problem.
First, setting the crosshair type to “simple crosshair” instead of “crosshair on sprite” completely removes the pen lag. The general application lag is still there though, so creating layers for example still takes a few seconds. However, the lag is only there, while the pen is above the tablet. When I move the pen away from the tablet, the whole software is responsive again.
Being a software developer myself, I want to make a random guess and say that the pen tablet may generate a lot of input messages related to pen position and tilt changes and the message handler is maybe not fast enough to handle it all and therefore slows the whole application down.
OS: Windows 10
Tabet: XP-Pen Artist 13.3 Pro
Aseprite Versions: 1.2.27, 1.3-beta4-x64