Listing Custom Post Type Categories by ID

Having some trouble figuring out the right method to use.

Not sure how to pass the correct arguments for get_the_catgory. I understand using wp_list_categories, but this only works outside of single post to list all site categories; I need to try to filter just the selected categories within the loop of a custompost type, and have them listed by ID.

Example: Category-ID1, Category -ID2, Category-ID3.

<?php
                              $categories = get_the_category();
                              $separator = '';
                              $output = '';
                              if ( ! empty( $categories ) ) {
                                  foreach( $categories as $category ) {
                                      $output .= '<li>' . esc_html( $category->name ) . '</li>' . $separator;
                                  }
                                  echo trim( $output, $separator );
                              }
                            ?>