Smart Objects can increase the file size of the document where they were created, so trimming the transparent pixels helps reduce the file size.
One way to create a Smart Object that has transparency and retain the image size of the original document would be to do the following:
- Create another layer
- Either make it a Solid Color adjustment layer or a new layer that you fill with any color
- Select both layers
- Convert the 2 layers into a single Smart Object
- Double-click the new Smart Object to open it
- Click on the eyeball to toggle off visibility of the solid color layer
- Save the Smart Object