How to calculate TPR and FPR for different threshold values for classification model?
To calculate TPR and FPR for different threshold values, you can follow the following steps:

First calculate prediction probability for each class instead of class prediction.

Sorting the testing cases based on the probability values of positive class (Assume binary classes are positive and negative class).

Then set the different cutoff/threshold values on probability scores and calculate $TPR= {TP \over (TP \ + \ FP)}$ and $FPR = {FP \over (FP \ + \ TN)}$ for each threshold value.