You cannot do it it in the sales transaction itself.
If you want to make a manual entry that appears in the I & E reports you certainly can. One way of doing this is by creating a couple of categories (you need two because of Moneydance following double entry accounting rules and because of the way moneydance works the actual gain/loss is not a figure in the register unlike in a set of accounting books), perhaps one category called Capital Gains, you could have another catch all category Tax Reporting or if you want to always isolate capital amounts Realised gains.
You then pass a single entry in the register of the sold security (to ensure the security name shows up in the reports) for the amount of the capital gain. In the Category field you use the Category Capital gains, in the transfer field the category in my Example Tax Reporting. You have the Capital gains category set to be included in your reports.