Tracking transactions in both directions
That's not possible without looking through all the transactions after this one and finding the one which spent it. Most block explorers keep a database of the transactions so you could look it up on one of them.