Hello,
you only need to categorize your actual contributions and withdrawals. The internal investment activity (like buying/selling funds, dividends, etc.) doesn’t impact your P&L and isn’t tied to your operating cash, so you don’t need to treat them as income or expenses.
What worked for me was creating a new Retirement Investment Clearing account (Other Current Asset or Equity, depending on how you track things) and using that to balance the internal activity. You can also use journal entries to reflect dividends and reinvestments if you want to track them cleanly without messing up your books.
But if you just care about reconciling and reporting cash flow, excluding everything except the contributions might honestly be enough, especially if your CPA handles year-end investment reporting anyway.
Hope that helps!