Maybe through the get_last_slide_collision function? You should then be able to access the position with something like:
var collision = get_last_slide_collision()
print ("Collided with: " + collision.get_collider().name)
print ("Collider position: ", collision.get_collider().global_position)
Though I have not tested the code above at all, but that is how you could do it so long as you are trying to detect side collisions. You could also use an Area2D slightly larger than the CharacterBody2D, have the Area2D follow the player (attach it as a child for example) and then use the on_body_entered
signal to detect collisions.