Although the shares cost you nothing, I think there might have been a "deemed" cost for tax purposes. Maybe another shareholder could advise here?
But presuming that, for tax purposes the cost is NIL, then you are right in saying that if you sold 100 for €2,000 you would pay 20% tax on €630 (presuming of course you'd no other capital gains that year).
A transfer to your wife would not be subject to tax and a later disposal would mean that you both could get the first €1,270 of a gain tax free.
If you transfer the shares to your children, you are treated as having sold them to them at market value. So, if 100 shares are worth €2,000 it is as if made a gain for that amount and tax (if any) is payable accordingly.
Your child will then be deemed to have purchased them for €2,000 and so will only make a capital gain if he/she sells the shares for a greater amount (or gifts them to someone other than a spouse when the market value has increased).