You can use layer_data() to extract the computed variables, as described e.g. here:
library(tidyverse)
p <- tibble(score = c(rnorm(300, 3, 3), rnorm(300, 6, 3)),
category = rep(c("a","b"), each = 300))|>
ggplot(aes(score, fill = category)) +
geom_density(alpha = 0.5)
computed_variables <- layer_data(p)
inversions <- computed_variables |>
group_by(x) |>
arrange(fill) |>
mutate(delta_y = diff(y)) |>
ungroup() |>
pull(delta_y) |>
sign() |>
diff() |>
(\(.x) which(.x != 0))() |>
(\(.x) computed_variables$x[.x])()
p +
geom_vline(xintercept = inversions,
linetype = "dotted")

Created on 2021-11-17 by the reprex package (v2.0.1)