On most systems. Only some later Intel CPUs support custom PCIe ratios, so in that case it can be determined.
Directly accessing the Clock Generator is a complicated method and due to the way how those chips are designed doing this might also result in issues and system instability.