Double spend question during fork
Yes, what you wrote is correct.

The number of confirmations a block has is defined as the number of block building on top of it.

The number of confirmations a transaction has is defined as 0 if the transactions is not included in any block and as the number of confirmations the oldest block* (block with the lowest block number; it's not about time) containing it has + 1 otherwise.

You know how many confirmations a block or a transaction has by knowing a (usually "the") longest blockchain has.

* Note that in any blockchain, a transaction is included in at most 1 block but there can be different blockchains and a transaction can be included in blocks having different block numbers in different blockchains.