The number of section does not appear when need referring label. This the code that use, see also the picture
\documentclass[a4paper,11pt,reqno]{amsart}
\usepackage{hyperref}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}
\newtcbtheorem[auto counter, number within=section]{TcbThm}{\textsc{Theorem}}{breakable, enhanced,
label separator=-,
left=1mm,
after skip=10pt,
before skip=10pt,
sharp corners,fontupper=\itshape,
attach boxed title to top left={xshift=-1.5mm, yshift=-3mm, yshifttext=-1mm},
boxed title style={opacityback=0,colframe=white,size=fbox,arc=0mm},
fonttitle=\bfseries, coltitle=black, colbacktitle=white,
colback=white, colframe=black,
borderline east={4pt}{-2pt}{white},
borderline north={4pt}{-2pt}{white},
separator sign none, description delimiters parenthesis}{th}
\NewDocumentEnvironment{thm}{ O{} O{} } % two optional arguments
{\TcbThm{#1}{#2}}
{\endTcbThm}
\newtcbtheorem[auto counter, number within=section]{TcbDef}{\textsc{Definition}}{breakable, enhanced,
label separator=-,
left=1mm,
after skip=10pt,
before skip=10pt,
sharp corners,fontupper=\itshape,
attach boxed title to top left={xshift=-1.5mm, yshift=-3mm, yshifttext=-1mm},
boxed title style={opacityback=0,colframe=white,size=fbox,arc=0mm},
fonttitle=\bfseries, coltitle=black, colbacktitle=white,
colback=white, colframe=black,
borderline east={4pt}{-2pt}{white},
borderline north={4pt}{-2pt}{white},
separator sign none, description delimiters parenthesis}{def}
\NewDocumentEnvironment{defin}{ O{} O{} } % two optional arguments
{\TcbDef{#1}{#2}}
{\endTcbDef}
\newtcbtheorem[auto counter, number within=section]{TcbLem}{\textsc{Lemma}}{breakable, enhanced,
label separator=-,
left=1mm,
after skip=10pt,
before skip=10pt,
sharp corners,fontupper=\itshape,
attach boxed title to top left={xshift=-1.5mm, yshift=-3mm, yshifttext=-1mm},
boxed title style={opacityback=0,colframe=white,size=fbox,arc=0mm},
fonttitle=\bfseries, coltitle=black, colbacktitle=white,
colback=white, colframe=black,
borderline east={4pt}{-2pt}{white},
borderline north={4pt}{-2pt}{white},
separator sign none, description delimiters parenthesis}{def}
\NewDocumentEnvironment{lem}{ O{} O{} } % two optional arguments
{\TcbLem{#1}{#2}}
{\endTcbLem}
\begin{document}
\section{section}
\begin{thm}\label{thm1}
kdd
\end{thm}
\ref{thm1}
\section{section}
\begin{thm}\label{thm2}
kdd
\end{thm}
\ref{thm2}
\section{section}
\section{section}
\end{document}