On a side note, when I used to bottle, I would only use the temperature of the beer at bottling time for my number. Got great carbonation to style with this. Granted, I was mostly bottling around 68F which is pretty darn close to most peak fermentation temps so there could be negligible difference.
To go into a bit more detail, CO2 solubility is based on temperature. Warmer liquid holds less CO2. Once active fermentation is done, there is no more CO2 being produced by the yeast. So at that point any CO2 lost from solution as it warms will not be replaced even if the temperature drops after that point. The warmest temperature reached represents the point where there’s the lowest CO2 concentration in the beer and is the best estimate of the amount of CO2 that is actually in the finished beer.
I think in reality the only time there would be a huge difference compared to actual beer temps is if you cold crash prior to bottling and are trying to use the cold-crash temp instead of the temp at the end of fermentation in your priming calculations.
Technically, it’s not the highest temp but rather the temp at which fermentation finished. Usually those are so close that it doesn’t matter. But in theory you could ferment a lager with a robust yeast like 34/70 at 50F, bring it up to 68F for a short D-rest, then drop it down to 46F to finish fermenting. I doubt anyone would do that but, if you did, you would use 46F for priming calculation.