Export calculates the size, as Spinebot mentioned, by checking the bounds at each frame that would be exported and using the maximal bounds from that. The editor doesn't provide a way to calculate that, except by seeing it on the export dialog.
You could calculate it by writing some runtime code. Here is an example that poses the skeleton and prints bone information. You would calculate the maximal bounds instead.
EsotericSoftware/spine-runtimesblob/4.2/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/BonePlotting.java
Ah, this is closer. It calculates the maximal bounds of an animation:
EsotericSoftware/spine-runtimesblob/4.2/spine-ts/spine-player/src/Player.ts#L793-L819
You can get the setup pose dimensions from the CLI:
$ spine -i spineboy-pro.spine
Project info: C:\Dev\spine\spine-launcher\eclipse\user\backup\spineboy-pro-189-0.0.00.spine
Spine version: 4.0.07
Dopesheet FPS: 30
Skeleton: spineboy-pro
Size: 418.45 x 686.2
...
This size is for the setup pose though, animations can be larger or smaller.