The best way to stop a transaction from counting against either your income OR your expenses is to classify it as a “Transfer”. Common tasks that often fall into this category include moving money from one account to another, or making a credit card payment.
See also: What are ‘Other’ Categories?