I believe ToA is similar to DA in this area. If not, disregard what follows.
In DA, one can see the net influence on a planet by cursor rollover or by clicking the cursor when on it. I think it also works for asteroid mines, but am not sure. Also in DA, one gets the unhappy face (showing high foreign influence) before it switches sides.
Building one or more influence bases is generally the best tactic when not near a planet. If a planet is near, building one or more influence structures on that planet is better. I typically position the influence base directly beside the threatened planet or base, but on the threat side. Note that one can add influence modules onto the influence base. The modules vary greatly in power, and the ones available increase as one researches the influence techs.
BTW, one mini-exploit is to use the minor planet beside the homeworld in trades. As long as one has high population on the homeworld, the planet will flip back to you shortly for free. Additionally, if one places the political capital on an influence bonus tile and then adds farms to grow the population high, that planet can also be used like the homeworld to flip nearby planets back to you.