If I chose an inductance for CCM, how do I calculate the "critical"
input voltage when the flyback operates in BCM?
As the input supply voltage rises, the converter will leave CCM and enter DCM. This is because the energy needed by the load per switching cycle can be fully delivered by the charge period of DCM.
That energy per cycle (for a constant load) needs to be kept constant. If it isn't kept constant then the output voltage across the load will vary and, of course, we don't want this to happen.
So, the formula that might help you is this: -
$$\text{Boundary duty cycle, }D_B = \dfrac{\frac{N_P}{N_S}\cdot V_{OUT}}{\frac{N_P}{N_S}\cdot V_{OUT}+V_{IN}}$$
An example of a 1:1 converter supplying 200 volts DC to a 600 Ω load (66.667 watts): -
When the input voltage is 273 volts, we are still just about in CCM. You can see this on the image above; the load power is 66.667 watts and the boundary power transfer limit that can be delivered is 66.624 watts.
This means it has to operate in CCM (to get that extra little bit of power to service the load). But, if the input supply voltage rises just a tad to 274 volts, the boundary power transfer limit rises to 66.830 watts i.e. fractionally above what is required by the load (66.667 watts) hence, to stabilize the output voltage, the converter must "drop" into DCM.
So, to calculate that boundary power limit you use this formula: -
$$\text{Boundary power limit, }P_{B} = \dfrac{V_{IN}^2\cdot D_B^2}{2\cdot L_P\cdot F_{SW}}$$
Using the two formulas listed above you should be able to combine them to get what you want. Each formula is derived on the example link from my basic website.