The treatment of growth in the IRA or 401(k) as marital or separate property is a matter of state law, so you should always consult the law in your state.
If you have IRA or 401(k) statements as of the date of the marriage, the separate property portion of the account typically is held to be the value of the account at the date of the marriage.
That is, typically, contributions that are made to the account during the marriage, and all growth that occurs on those contributions in the account during the marriage, are treated as marital property.
In the unlikely event that no contributions are made to the account after the marriage, and the account is treated by the parties as separate property, then growth in the account during the marriage may be treated as separate property.
If you do not have a statement of the value of the account on the date of the marriage, you may estimate the marital property portion as the current value of the account multiplied by a coverture fraction. The coverture fraction would be calculated as: Number of days during the marriage / Number of days the account has been in existence. The separate property amount would then be: current value – marital property portion.
If you know the value at date of marriage, you can attempt to assess how much that value would have grown during the marriage. Add to that any growth after separation. That would be the separate property portion.
If there have been distributions, the accounting becomes extremely complex.