Here's how you post it:
2B Jim Smith (ML) - Retain 35%
SP Rob Lowe (A)
A team option, or any contract after that, will not be included in the retained salary. So, if January 1, you trade a player with two years left on his contract at a salary of $10M per year with a team option after the first year and a $1M buyout, and you retain 25% of the player's salary, then you will have $2.5M applied to your finances for this year, and the other team will now evaluate the option. If they execute the option, then they will have to pay the full $10M the following season - the original team does not have to pay 25% of the option year.
However, player options, opt-outs, and vesting options do not have the same logic. In these cases, you are on the hook for the entire portion of the salary. However, if the option is declined, or the vesting option does not vest, then you will not be on the hook for any future salary.