Transition probabilities for general birth–death processes with applications in ecology, genetics, and evolution