Presumably you are under age 59½, otherwise there would be no need to ask about the early-distribution penalty. Your ex-spouse's contribution and conversion basis in the Roth IRA transferred to you in proportion to the balance transferred to your Roth IRA at the time of the transfer, so you'll need to know the amount of basis your ex-spouse had immediately prior to the transfer. The custodian has no knowledge of basis amounts so it won't appear on the Form 1099-R; you'll need to get that from your ex-spouse if you don't already know it.
You can include the contribution and conversion basis amounts when TurboTax asks for them after you enter the Form 1099-R reporting the distribution from your
Roth IRA and you click the Continue button on the Your 1099-R Entries
page or, if you are using the CD/download version of TurboTax, you can enter these as adjustments to your basis (which can only be done in forms mode on lines 61 through 72 of the IRA Information Worksheet). TurboTax will use these amounts to calculate the amount of your distribution that is attributable to earnings and is therefore taxable and subject to an early-distribution penalty unless you have an penalty exception that applies. Divorce is not an exception
This is not in any way like an inheritance. The Roth IRA transferred to you incident to divorce is treated as if it has always been yours. In addition to acquiring a proportional amount of the basis, you also acquire the year for which your ex-spouse first contributed to a Roth IRA, if earlier than your own.
Ideally you would include an explanation statement with your tax return indicating how you acquired the contribution and conversion basis from your ex-spouse, but TurboTax does not provide a good way to do this. You would probably need to prepare the statement manually and include it with your mailed your tax return. You could omit the explanation statement, but you would need to provide it if the IRS ever questions the amount of basis you claim.